﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Web;

namespace ueEngine.Framework.Configuration
{
    public class SilderRwsource
    {
        static List<SilderItem> resouece;
        static SilderRwsource()
        {
            XElement xe = XElement.Load(HttpContext.Current.Server.MapPath("/content/config/slider.xml"));
            resouece = xe.Element("index").Elements("item")
                .Select(c => new SilderItem()
                {
                    Action = c.Attribute("action").Value,
                    Alt = c.Attribute("alt").Value,
                    Description = c.Attribute("descript").Value,
                    Title = c.Attribute("title").Value,
                    Uri = c.Attribute("uri").Value
                }).ToList();
        }
        public static List<SilderItem> Get
        {
            get
            {
                return resouece;
            }
        }
        public class SilderItem
        {
            public string Title { get; set; }
            public string Alt { get; set; }
            public string Uri { get; set; }
            public string Action { get; set; }
            public string Description { get; set; }
        }
    }
}
